<template>
  <div class="son">
    <h4>这是son组件(孙)</h4>
    <h4>{{ name }}---{{ price }}</h4>
  </div>
</template>

<script>
import { inject, toRefs } from "vue";
export default {
  name: "son",
  setup() {
    const x = inject("car");
    console.log('car :>> ', x);
    return { ...toRefs(x) };
  },
};
</script>

<style scoped>
.son {
  background-color: orange;
  padding: 15px;
}
</style>
